﻿using Prism.Commands;
using Prism.Mvvm;
using Prism.Regions;
using System;

namespace TangGuo.ViewModels
{
    public class MainWindowViewModel : BindableBase
    {
        private string _title = "东家小院";
        public string Title
        {
            get { return _title; }
            set { SetProperty(ref _title, value); }
        }
        private readonly IRegionManager regionManager;
        public DelegateCommand<string> OpenViewCommand { get; private set; }
        public MainWindowViewModel(IRegionManager regionManager)
        {
            this.regionManager=regionManager;
            
            OpenViewCommand = new DelegateCommand<string>(OpenView);
        }

        private void OpenView(string obj)
        {
            regionManager.Regions["ContentRegion"].RequestNavigate(obj);
        }
    }
}
